home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 316 / libsrc / strout.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-10-20  |  539 b   |  28 lines

  1. #if defined(LIBC_SCCS) && !defined(lint)
  2. static char sccsid[] = "@(#)strout.c    5.2 (Berkeley) 3/9/86";
  3. #endif LIBC_SCCS and not lint
  4.  
  5. #include    <stdio.h>
  6.  
  7. _strout(count, string, adjust, file, fillch)
  8. register char *string;
  9. register count;
  10. int adjust;
  11. register FILE *file;
  12. {
  13.     while (adjust < 0) {
  14.         if (*string=='-' && fillch=='0') {
  15.             putc(*string++, file);
  16.             count--;
  17.         }
  18.         putc(fillch, file);
  19.         adjust++;
  20.     }
  21.     while (--count>=0)
  22.         putc(*string++, file);
  23.     while (adjust) {
  24.         putc(fillch, file);
  25.         adjust--;
  26.     }
  27. }
  28.